package com.ticket.api.controller;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ticket.WechatConfig.HttpRequest;
@RestController
@RequestMapping("weChat")
public class WeChatOpen {

    @Autowired
    HttpRequest http;

        @RequestMapping("weChatOpen")
        public String loginWechat(@RequestParam("code")String code){
            try {
             return   http.openid(code);
            } catch (Exception e) {
                e.printStackTrace();
            }


            return  null;
        }
}
